#ifndef CHARACTER_H
#define CHARACTER_H
#include "includes.h"
#include "RigidBody.h"

enum CHAR_STATE { WALKING, JUMPING };

class Character : public RigidBody{
protected:
    CHAR_STATE state;
    int hp, maxHP,hpDelay;

public:
    Character(float _mass, AABB geo):RigidBody(_mass,geo),hp(100),maxHP(100),hpDelay(0){}
    void setMaxHP(int _mhp){maxHP=_mhp;}
    void setHP(int _hp){hp=CLAMP(_hp,0,maxHP);}
    int getHP(){return hp;}
    int getMaxHP(){return maxHP;}
    void damage(int dmg){
        if(hpDelay>0)return;
        setHP(hp-dmg);
        hpDelay=GS->getHpChangeDelay();
    }

    virtual void render()=0;
    virtual void goForward()=0;
    virtual void goBackward()=0;
    virtual void goLeft()=0;
    virtual void goRight()=0;
    virtual void Jump()=0;
    virtual void setState(CHAR_STATE s) {state=s;}

    CHAR_STATE getState() {return state;}
};

#endif // CHARACTER_H
